<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Contract-add</title>
    <!-- 引入layui 样式-->
    <link rel="stylesheet" href="../../static/css/style.css"/>
    <link rel="stylesheet" href="../../static/layer/css/layui.css"/>
    <link rel="stylesheet" href="../../static/css/font-awesome.min.css">
    <link rel="stylesheet" href="../../static/ucss/contract/loan.css"/>
    <style>
        .layui-form-label {
            width: 100px;
        }

        .con_left {
            margin-left: 30px;
        }

        .class_btn_add {
            display: block;
            float: right;
        }

        .layui-table-cell {
            height: inherit !important;
        }

        .layui-table-body {
            height: 202px;
        }
    </style>
</head>

<body>
<form class="layui-form">
    <div class="layui-tab layui-tab-brief" lay-filter="contractInfoTabBrief">
        <ul class="layui-tab-title">
            <li class="layui-this">企业信息</li>
            <li class="contractInfo">人员信息</li>
            <li class="billInfo CWXX">资产信息</li>
            <li class="collateral_info">抵押物信息</li>

        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <blockquote class="layui-elem-quote">股东信息
                    <button class="layui-btn layui-btn-small layui-btn-normal class_btn_add class_isShow" type="button"
                            onclick="openShare()">添加
                    </button>
                </blockquote>
                <div class="layui-tab layui-tab-brief ">
                    <table id="shareholder" lay-filter="shareholder"></table>
                    <div style="display: none;" id="shareholder_caozuo">
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="share_del">删除</a>
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="share_update">修改</a>
                    </div>

                </div>
                <!--企业信息-->


                <blockquote class="layui-elem-quote">主要银行账户信息
                    <button class="layui-btn layui-btn-small layui-btn-normal class_btn_add class_isShow" type="button"
                            onclick="openBankInfo()">添加
                    </button>
                </blockquote>
                <div class="layui-tab layui-tab-brief " lay-filter="docDemoTabBrief">
                    <table id="bank_info" lay-filter="bank_info"></table>
                    <div style="display: none;" id="bank_info_caozuo">
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="bank_info_del">删除</a>
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="bank_info_update">修改</a>
                    </div>

                </div>

            </div>
            <!--合同信息-->
            <div class="layui-tab-item">


                <!--人员信息-->

                <blockquote class="layui-elem-quote">人员信息
                    <button class="layui-btn layui-btn-small layui-btn-normal class_btn_add class_isShow" type="button"
                            onclick="opentPersonnelInfo()">添加
                    </button>
                </blockquote>
                <div class="layui-tab layui-tab-brief ">
                    <table id="personnel_info" lay-filter="personnel_info"></table>
                    <div style="display: none;" id="personnel_info_caozuo">
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="personnel_info_del">删除</a>
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="personnel_info_update">修改</a>
                    </div>

                </div>
                <!--人员情况-->


                <blockquote class="layui-elem-quote">人员情况
                    <button class="layui-btn layui-btn-small layui-btn-normal class_btn_add  class_isShow" type="button"
                            onclick="openPersonnelSituation()">添加
                    </button>
                </blockquote>
                <div class="layui-tab layui-tab-brief " lay-filter="docDemoTabBrief">
                    <table id="personnel_situation" lay-filter="personnel_situation"></table>
                    <div style="display: none;" id="personnel_situation_caozuo">
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="personnel_situation_del">删除</a>
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="personnel_situation_update">修改</a>
                    </div>

                </div>




            </div>
            <!--不动产信息-->
            <div class="layui-tab-item  CWXX">
                <blockquote class="layui-elem-quote">不动产信息
                    <button class="layui-btn layui-btn-small layui-btn-normal class_btn_add  class_isShow" type="button"
                            onclick="openRealEstateInfo()">添加
                    </button>
                </blockquote>
                <div class="layui-tab layui-tab-brief ">
                    <table id="realEstateInfo" lay-filter="realEstateInfo"></table>
                    <div style="display: none;" id="realEstateInfo_caozuo">
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="realEstateInfo_del">删除</a>
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="realEstateInfo_update">修改</a>
                    </div>

                </div>
                <!--动产信息-->


                <blockquote class="layui-elem-quote">动产信息
                    <button class="layui-btn layui-btn-small layui-btn-normal class_btn_add class_isShow " type="button"
                            onclick="openMovableInfo()">添加
                    </button>
                </blockquote>
                <div class="layui-tab layui-tab-brief  " lay-filter="docDemoTabBrief">
                    <table id="movableInfo" lay-filter="movableInfo"></table>
                    <div style="display: none;" id="movableInfo_caozuo">
                        <a class="layui-btn  layui-btn-mini class_isShow " lay-event="movableInfo_del">删除</a>
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="movableInfo_update">修改</a>
                    </div>

                </div>


            </div>

            <!--抵押物-->
            <div class="layui-tab-item collateral_info">
                <blockquote class="layui-elem-quote">不动产信息
                    <button class="layui-btn layui-btn-small layui-btn-normal class_btn_add class_isShow " type="button"
                            onclick="openCollateralInfo()">添加
                    </button>
                </blockquote>
                <div class="layui-tab layui-tab-brief  ">
                    <table id="collateralInfo" lay-filter="collateralInfo"></table>
                    <div style="display: none;" id="collateralInfo_caozuo">
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="collateralInfo_del">删除</a>
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="collateralInfo_update">修改</a>
                    </div>

                </div>
                <blockquote class="layui-elem-quote">动产信息
                    <button class="layui-btn layui-btn-small layui-btn-normal class_btn_add class_isShow " type="button"
                            onclick="openMovablesInfo()">添加
                    </button>
                </blockquote>
                <div class="layui-tab layui-tab-brief  ">
                    <table id="collateralMovablesInfo" lay-filter="collateralMovablesInfo"></table>
                    <div style="display: none;" id="collateralMovablesInfo_caozuo">
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="collateralMovablesInfo_del">删除</a>
                        <a class="layui-btn  layui-btn-mini class_isShow" lay-event="collateralMovablesInfo_update">修改</a>
                    </div>

                </div>
            </div>


        </div>
    </div>
    <blockquote class="blockquote-bottom">
        <div class="blockquote-bottom-item">
            <a class="layui-btn layui-btn-primary layui-btn-small cancelBtn" onclick="cancel();">返回</a>
            <!--<a class="layui-btn layui-btn-small layui-btn-disabled submitBtn" onclick="operate.submit(this, 0);">提交</a>-->
        </div>
    </blockquote>

</form>
<script type="text/javascript" src="../../static/layer/layui.js"></script>
<script type="text/javascript" src="../../static/js/common/dateUtils.js"></script>
<script type="text/javascript" src="../../static/js/common/typeUtils.js"></script>
<script type="text/javascript" src="../../static/js/common/queryUtils.js"></script>
<script>
    // var UUID = getNum(); //uuid
    var $, element, layer, laydate, form, table;
    var UUID = QueryUtils.GetQueryString("UUID");//获取审核的合同id

    var isShowType = QueryUtils.GetQueryString("isShowType");//


    layui.use(['jquery', 'element', 'layer', 'laydate', 'form', 'upload', 'table'], function () {
        // 加载元素控件
        $ = layui.jquery, element = layui.element, layer = layui.layer, laydate = layui.laydate, table = layui.table, form = layui.form;
debugger

        if(isShowType=="show"){
            $(".class_isShow").html("");
            $(".class_isShow").css("width","0px").css("height","0px");
        }

        var data = {};
        data.LOAN_ID = UUID;
        debugger
        //股东信息
        table.render({
            elem: '#shareholder'
            , where: data
            , url: '/LoanQTController/shareholderList'
            , cols: [[
                {field: 'ROWNUM', event: 'setSign', title: '序号', width: 60}
                , {field: 'TYPE', event: 'setSign', title: '股东类型', width: 120}
                , {field: 'SH_NAME', event: 'setSign', title: '姓名/公司名称', width: 150}
                , {field: 'COMPANY_TYPE', event: 'setSign', title: '公司类型', width: 150}
                , {field: 'CARD_NO', event: 'setSign', title: ' 身份证号/统一社会信用代码', width: 250}
                , {field: 'NATIONALITY', event: 'setSign', title: '国籍', width: 120}
                , {field: 'CONFIS', event: 'setSign', title: '认缴(万元)', width: 120}
                , {field: 'REAL_PAYMENT', event: 'setSign', title: '实缴(万元)', width: 120}
                , {field: 'CONFIS_DATE', event: 'setSign', title: '认缴时间', width: 120}
                , {field: 'CGBI', event: 'setSign', title: '持股比例(%)', width: 120}

                , {fixed: 'right', width: 250, align: 'center', title: '操作', toolbar: '#shareholder_caozuo'}

            ]]
            , id: 'shareholder_table_id'
        });
        //主要银行账户信息

        table.render({
            elem: '#bank_info'
            , where: data
            , url: '/LoanQTController/bankList'
            , cols: [[
                {field: 'ROWNUM', event: 'setSign', title: '序号', width: 60}
                , {field: 'TYPE', event: 'setSign', title: '银行类型', width: 250}
                , {field: 'BANK_NAME', event: 'setSign', title: '银行名称', width: 250}
                , {field: 'BANK_NUM', event: 'setSign', title: '银行账号', width: 250}
                , {fixed: 'right', width: 250, align: 'center', title: '操作', toolbar: '#bank_info_caozuo'}

            ]]
            , id: 'bank_info_tb_id'
        });


        <!-- 人员信息  开始-->
        //主要人员信息

        table.render({
            elem: '#personnel_situation'
            , where: data
            , url: '/LoanQTController/personnelSituationList'
            , cols: [[
                {field: 'ROWNUM', event: 'setSign', title: '序号', width: 60}
                , {field: 'EMPLOYEES_NUM', event: 'setSign', title: '员工总人数', width: 350}
                , {field: 'SOCIAL_SECURITY_NUM', event: 'setSign', title: '缴纳社保人数', width: 350}
                , {fixed: 'right', width: 250, align: 'center', title: '操作', toolbar: '#personnel_situation_caozuo'}

            ]]
            , id: 'personnel_situation_id'
        });

        table.render({
            elem: '#personnel_info'
            , where: data
            , url: '/LoanQTController/personnelInfoList'
            , cols: [[
                {field: 'ROWNUM', event: 'setSign', title: '序号', width: 60}
                , {field: 'TYPE', event: 'setSign', title: '类型', width: 100}
                , {field: 'PERSONNEL_NAME', event: 'setSign', title: '姓名', width: 100}
                , {field: 'NATIONALITY', event: 'setSign', title: '国籍', width: 100}
                , {field: 'CARD_NO', event: 'setSign', title: '身份证号码', width: 150}
                , {field: 'NAME_FAMILY', event: 'setSign', title: '民族', width: 100}
                , {field: 'EDUCATION', event: 'setSign', title: '学历', width: 150}
                , {field: 'NOW_ADDRESS', event: 'setSign', title: ' 住宅地址', width: 150}
                , {field: 'EXPERIENCE_EMPLOYMENT', event: 'setSign', title: ' 从业经历', width: 150}
                , {fixed: 'right', width: 250, align: 'center', title: '操作', toolbar: '#personnel_info_caozuo'}

            ]]
            , id: 'personnel_info_id'
        });


        //不动产信息
        table.render({
            elem: '#realEstateInfo'
            , where: data
            , url: '/LoanQTController/realEstateInfoList'
            , cols: [[
                {field: 'ROWNUM', event: 'setSign', title: '序号', width: 60}
                , {field: 'TYPE', event: 'setSign', title: '类型', width: 100}
                , {field: 'MEASURE_AREA', event: 'setSign', title: '面积(㎡)', width: 100}
                , {field: 'LOCATION', event: 'setSign', title: '坐落位置', width: 100}
                , {field: 'IS_MORTGAGE', event: 'setSign', title: '是否抵押', width: 150}
                , {field: 'MORTGAGE_PERSON', event: 'setSign', title: '抵押人', width: 100}
                , {field: 'MORTGAGE_PERIOD', event: 'setSign', title: '抵押期限(年)', width: 150}
                , {field: 'MORTGAGE_DATE', event: 'setSign', title: ' 抵押时间', width: 150}
                , {field: 'MORTGAGE_PRICE', event: 'setSign', title: ' 抵押金额(元)', width: 150}
                , {fixed: 'right', width: 250, align: 'center', title: '操作', toolbar: '#realEstateInfo_caozuo'}

            ]]
            , id: 'realEstateInfo_id'
        });

        //动产信息
        table.render({
            elem: '#movableInfo'
            , where: data
            , url: '/LoanQTController/movableInfoList'
            , cols: [[
                {field: 'ROWNUM', event: 'setSign', title: '序号', width: 60}
                , {field: 'TYPE', event: 'setSign', title: '类型', width: 100}
                , {field: 'BRAND', event: 'setSign', title: '品牌', width: 100}
                , {field: 'PURCHASE_DATE', event: 'setSign', title: '购买日期', width: 100}
                , {field: 'ORIGINAL_VALUE', event: 'setSign', title: '原值(元)', width: 150}
                , {field: 'NET_WORTH', event: 'setSign', title: '净值(元)', width: 150}
                , {field: 'MORTGAGE_PERSON', event: 'setSign', title: '抵押人', width: 100}
                , {field: 'MORTGAGE_PERIOD', event: 'setSign', title: '抵押期限(年)', width: 150}
                , {field: 'MORTGAGE_DATE', event: 'setSign', title: ' 抵押时间', width: 150}
                , {field: 'MORTGAGE_PRICE', event: 'setSign', title: ' 抵押金额(元)', width: 150}
                , {fixed: 'right', width: 250, align: 'center', title: '操作', toolbar: '#movableInfo_caozuo'}

            ]]
            , id: 'movableInfo_id'
        });





        //抵押物信息   不动产信息
        table.render({
            elem: '#collateralInfo'
            , where: data
            , url: '/LoanQTController/collateralInfoList'
            , cols: [[
                {field: 'ROWNUM', event: 'setSign', title: '序号', width: 60}
                , {field: 'TYPE', event: 'setSign', title: '类型', width: 150}
                , {field: 'MEASURE_AREA', event: 'setSign', title: '面积(㎡)', width: 150}
                , {field: 'LOCATION', event: 'setSign', title: '坐落位置', width: 150}
                , {field: 'PROPERTY_HOLDER', event: 'setSign', title: '产权人', width: 150}
                , {field: 'MORTGAGE_VAL', event: 'setSign', title: '抵押估值(元)', width: 150}
                , {fixed: 'right', width: 250, align: 'center', title: '操作', toolbar: '#collateralInfo_caozuo'}

            ]]
            , id: 'collateralInfo_id'
        });
        //抵押物信息   动产信息
        table.render({
            elem: '#collateralMovablesInfo'
            , where: data
            , url: '/LoanQTController/collateralMovablesInfoList'
            , cols: [[
                {field: 'ROWNUM', event: 'setSign', title: '序号', width: 60}
                , {field: 'TYPE', event: 'setSign', title: '类型', width: 150}
                , {field: 'PURCHASE_DATE', event: 'setSign', title: '购买日期', width: 150}
                , {field: 'DEVICE_NAME', event: 'setSign', title: '设备名称/品牌', width: 150}
                , {field: 'PROPERTY_HOLDER', event: 'setSign', title: '产权人', width: 150}
                , {field: 'MORTGAGE_VAL', event: 'setSign', title: '抵押估值(元)', width: 150}
                , {fixed: 'right', width: 250, align: 'center', title: '操作', toolbar: '#collateralMovablesInfo_caozuo'}

            ]]
            , id: 'collateralMovablesInfo_id'
        });
        //股东信息
        table.on('tool(shareholder)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值


            if (layEvent === 'share_del') {

                layer.msg('确认删除信息吗', {
                    time: 0
                    , btn: ['确定', '取消']
                    , shade: 0.3
                    , yes: function (index) {
                        var dataSource = {};

                        dataSource.ID = data.ID;
                        $.ajax({
                            url: "/LoanQTController/share_del",
                            data: dataSource,
                            dataType: "json",
                            type: "post",
                            async: false,
                            success: function (res) {
                                if (res.errcode === "0") {
                                    layer.close(index);  // 关闭新建合同页面
                                    table.reload("shareholder_table_id");
                                    parent.layer.msg("删除成功");   // 父页面弹出保存成功
                                } else if (res.errcode === "1") {
                                    layer.msg("删除失败");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.msg("删除失败");
                                console.error(XMLHttpRequest.status);
                                console.error(XMLHttpRequest.readyState);
                                console.error(textStatus);
                            }
                        });


                    }
                })

            } else if (layEvent === 'share_update') {

                parent.layer.open({
                    type: 2,    //弹出类型
                    title: '新增股东',   //标题
                    closeBtn: 1,    //显示关闭按钮
                    shade: [0.3],   //遮罩透明度
                    area: ['600px', '700px'],  //打开窗口的宽高
                    time: 0,    //几秒后自动关闭，默认0时不关闭
                    anim: 1,    //动画效果
                    resize: false,  //设置成不允许拉伸
                    content: '../../../webhtml/loan/loan_shareholder_add.html?ID=' + data.ID + '&UUID=' + UUID,
                    end: function (date) {
                        table.reload("shareholder_table_id");
                    }
                });


            }


        });


        //银行信息
        table.on('tool(bank_info)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值


            if (layEvent === 'bank_info_del') {

                layer.msg('确认删除信息吗', {
                    time: 0
                    , btn: ['确定', '取消']
                    , shade: 0.3
                    , yes: function (index) {
                        var dataSource = {};

                        dataSource.ID = data.ID;
                        $.ajax({
                            url: "/LoanQTController/bank_del",
                            data: dataSource,
                            dataType: "json",
                            type: "post",
                            async: false,
                            success: function (res) {
                                if (res.errcode === "0") {
                                    layer.close(index);  // 关闭新建合同页面
                                    table.reload("bank_info_tb_id");
                                    parent.layer.msg("删除成功");   // 父页面弹出保存成功
                                } else if (res.errcode === "1") {
                                    layer.msg("删除失败");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.msg("删除失败");
                                console.error(XMLHttpRequest.status);
                                console.error(XMLHttpRequest.readyState);
                                console.error(textStatus);
                            }
                        });


                    }
                })

            } else if (layEvent === 'bank_info_update') {

                parent.layer.open({
                    type: 2,    //弹出类型
                    title: '修改银行',   //标题
                    closeBtn: 1,    //显示关闭按钮
                    shade: [0.3],   //遮罩透明度
                    area: ['500px', '300px'],  //打开窗口的宽高
                    time: 0,    //几秒后自动关闭，默认0时不关闭
                    anim: 1,    //动画效果
                    resize: false,  //设置成不允许拉伸
                    content: '../../../webhtml/loan/loan_bank_add.html?ID=' + data.ID + '&UUID=' + UUID,
                    end: function (date) {
                        table.reload("bank_info_tb_id");
                    }
                });


            }


        });







        //个人情况
        table.on('tool(personnel_situation)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值


            if (layEvent === 'personnel_situation_del') {

                layer.msg('确认删除信息吗', {
                    time: 0
                    , btn: ['确定', '取消']
                    , shade: 0.3
                    , yes: function (index) {
                        var dataSource = {};

                        dataSource.ID = data.ID;
                        $.ajax({
                            url: "/LoanQTController/PersonnelSituation_del",
                            data: dataSource,
                            dataType: "json",
                            type: "post",
                            async: false,
                            success: function (res) {
                                if (res.errcode === "0") {
                                    layer.close(index);  // 关闭新建合同页面
                                    table.reload("personnel_situation_id");
                                    parent.layer.msg("删除成功");   // 父页面弹出保存成功
                                } else if (res.errcode === "1") {
                                    layer.msg("删除失败");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.msg("删除失败");
                                console.error(XMLHttpRequest.status);
                                console.error(XMLHttpRequest.readyState);
                                console.error(textStatus);
                            }
                        });


                    }
                })

            } else if (layEvent === 'personnel_situation_update') {

                parent.layer.open({
                    type: 2,    //弹出类型
                    title: '修改个人情况',   //标题
                    closeBtn: 1,    //显示关闭按钮
                    shade: [0.3],   //遮罩透明度
                    area: ['500px', '300px'],  //打开窗口的宽高
                    time: 0,    //几秒后自动关闭，默认0时不关闭
                    anim: 1,    //动画效果
                    resize: false,  //设置成不允许拉伸
                    content: '../../../webhtml/loan/loan_personnel_situation_add.html?ID=' + data.ID + '&UUID=' + UUID,
                    end: function (date) {
                        table.reload("personnel_situation_id");
                    }
                });


            }


        });






        //个人信息
        table.on('tool(personnel_info)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值


            if (layEvent === 'personnel_info_del') {

                layer.msg('确认删除信息吗', {
                    time: 0
                    , btn: ['确定', '取消']
                    , shade: 0.3
                    , yes: function (index) {
                        var dataSource = {};

                        dataSource.ID = data.ID;
                        $.ajax({
                            url: "/LoanQTController/personnelInfo_del",
                            data: dataSource,
                            dataType: "json",
                            type: "post",
                            async: false,
                            success: function (res) {
                                if (res.errcode === "0") {
                                    layer.close(index);  // 关闭新建合同页面
                                    table.reload("personnel_info_id");
                                    parent.layer.msg("删除成功");   // 父页面弹出保存成功
                                } else if (res.errcode === "1") {
                                    layer.msg("删除失败");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.msg("删除失败");
                                console.error(XMLHttpRequest.status);
                                console.error(XMLHttpRequest.readyState);
                                console.error(textStatus);
                            }
                        });


                    }
                })

            } else if (layEvent === 'personnel_info_update') {

                parent.layer.open({
                    type: 2,    //弹出类型
                    title: '修改个人信息',   //标题
                    closeBtn: 1,    //显示关闭按钮
                    shade: [0.3],   //遮罩透明度
                    area: ['700px', '80%'],  //打开窗口的宽高
                    time: 0,    //几秒后自动关闭，默认0时不关闭
                    anim: 1,    //动画效果
                    resize: false,  //设置成不允许拉伸
                    content: '../../../webhtml/loan/loan_personnel_info_add.html?ID=' + data.ID + '&UUID=' + UUID,
                    end: function (date) {
                        table.reload("personnel_info_id");
                    }
                });


            }


        });


        //资产信息  -不动产
        table.on('tool(realEstateInfo)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值


            if (layEvent === 'realEstateInfo_del') {

                layer.msg('确认删除信息吗', {
                    time: 0
                    , btn: ['确定', '取消']
                    , shade: 0.3
                    , yes: function (index) {
                        var dataSource = {};

                        dataSource.ID = data.ID;
                        $.ajax({
                            url: "/LoanQTController/realEstateInfo_del",
                            data: dataSource,
                            dataType: "json",
                            type: "post",
                            async: false,
                            success: function (res) {
                                if (res.errcode === "0") {
                                    layer.close(index);  // 关闭新建合同页面
                                    table.reload("realEstateInfo_id");
                                    parent.layer.msg("删除成功");   // 父页面弹出保存成功
                                } else if (res.errcode === "1") {
                                    layer.msg("删除失败");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.msg("删除失败");
                                console.error(XMLHttpRequest.status);
                                console.error(XMLHttpRequest.readyState);
                                console.error(textStatus);
                            }
                        });


                    }
                })

            } else if (layEvent === 'realEstateInfo_update') {

                parent.layer.open({
                    type: 2,    //弹出类型
                    title: '修改不动产信息',   //标题
                    closeBtn: 1,    //显示关闭按钮
                    shade: [0.3],   //遮罩透明度
                    area: ['700px', '80%'],  //打开窗口的宽高
                    time: 0,    //几秒后自动关闭，默认0时不关闭
                    anim: 1,    //动画效果
                    resize: false,  //设置成不允许拉伸
                    content: '../../../webhtml/loan/loan_realEstateInfo_add.html?ID=' + data.ID + '&UUID=' + UUID,
                    end: function (date) {
                        table.reload("realEstateInfo_id");
                    }
                });


            }


        });

        //资产信息  -动产
        table.on('tool(movableInfo)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值


            if (layEvent === 'movableInfo_del') {

                layer.msg('确认删除信息吗', {
                    time: 0
                    , btn: ['确定', '取消']
                    , shade: 0.3
                    , yes: function (index) {
                        var dataSource = {};

                        dataSource.ID = data.ID;
                        $.ajax({
                            url: "/LoanQTController/movableInfo_del",
                            data: dataSource,
                            dataType: "json",
                            type: "post",
                            async: false,
                            success: function (res) {
                                if (res.errcode === "0") {
                                    layer.close(index);  // 关闭新建合同页面
                                    table.reload("movableInfo_id");
                                    parent.layer.msg("删除成功");   // 父页面弹出保存成功
                                } else if (res.errcode === "1") {
                                    layer.msg("删除失败");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.msg("删除失败");
                                console.error(XMLHttpRequest.status);
                                console.error(XMLHttpRequest.readyState);
                                console.error(textStatus);
                            }
                        });


                    }
                })

            } else if (layEvent === 'movableInfo_update') {

                parent.layer.open({
                    type: 2,    //弹出类型
                    title: '修改动产信息',   //标题
                    closeBtn: 1,    //显示关闭按钮
                    shade: [0.3],   //遮罩透明度
                    area: ['700px', '80%'],  //打开窗口的宽高
                    time: 0,    //几秒后自动关闭，默认0时不关闭
                    anim: 1,    //动画效果
                    resize: false,  //设置成不允许拉伸
                    content: '../../../webhtml/loan/loan_movable_info_add.html?ID=' + data.ID + '&UUID=' + UUID,
                    end: function (date) {
                        table.reload("movableInfo_id");
                    }
                });


            }


        });



        //抵押物  不动产
        table.on('tool(collateralInfo)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值


            if (layEvent === 'collateralInfo_del') {

                layer.msg('确认删除信息吗', {
                    time: 0
                    , btn: ['确定', '取消']
                    , shade: 0.3
                    , yes: function (index) {
                        var dataSource = {};

                        dataSource.ID = data.ID;
                        $.ajax({
                            url: "/LoanQTController/collateralInfo_del",
                            data: dataSource,
                            dataType: "json",
                            type: "post",
                            async: false,
                            success: function (res) {
                                if (res.errcode === "0") {
                                    layer.close(index);  // 关闭新建合同页面
                                    table.reload("collateralInfo_id");
                                    parent.layer.msg("删除成功");   // 父页面弹出保存成功
                                } else if (res.errcode === "1") {
                                    layer.msg("删除失败");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.msg("删除失败");
                                console.error(XMLHttpRequest.status);
                                console.error(XMLHttpRequest.readyState);
                                console.error(textStatus);
                            }
                        });


                    }
                })

            } else if (layEvent === 'collateralInfo_update') {

                parent.layer.open({
                    type: 2,    //弹出类型
                    title: '修改动产信息',   //标题
                    closeBtn: 1,    //显示关闭按钮
                    shade: [0.3],   //遮罩透明度
                    area: ['700px', '60%'],  //打开窗口的宽高
                    time: 0,    //几秒后自动关闭，默认0时不关闭
                    anim: 1,    //动画效果
                    resize: false,  //设置成不允许拉伸
                    content: '../../../webhtml/loan/loan_collateral_info_add.html?ID=' + data.ID + '&UUID=' + UUID,
                    end: function (date) {
                        table.reload("collateralInfo_id");
                    }
                });


            }


        });

        //抵押物  动产
        table.on('tool(collateralMovablesInfo)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值


            if (layEvent === 'collateralMovablesInfo_del') {

                layer.msg('确认删除信息吗', {
                    time: 0
                    , btn: ['确定', '取消']
                    , shade: 0.3
                    , yes: function (index) {
                        var dataSource = {};

                        dataSource.ID = data.ID;
                        $.ajax({
                            url: "/LoanQTController/collateralMovablesInfo_del",
                            data: dataSource,
                            dataType: "json",
                            type: "post",
                            async: false,
                            success: function (res) {
                                if (res.errcode === "0") {
                                    layer.close(index);  // 关闭新建合同页面
                                    table.reload("collateralMovablesInfo_id");
                                    parent.layer.msg("删除成功");   // 父页面弹出保存成功
                                } else if (res.errcode === "1") {
                                    layer.msg("删除失败");
                                }
                            },
                            error: function (XMLHttpRequest, textStatus, errorThrown) {
                                layer.msg("删除失败");
                                console.error(XMLHttpRequest.status);
                                console.error(XMLHttpRequest.readyState);
                                console.error(textStatus);
                            }
                        });


                    }
                })

            } else if (layEvent === 'collateralMovablesInfo_update') {

                parent.layer.open({
                    type: 2,    //弹出类型
                    title: '修改动产信息',   //标题
                    closeBtn: 1,    //显示关闭按钮
                    shade: [0.3],   //遮罩透明度
                    area: ['700px', '60%'],  //打开窗口的宽高
                    time: 0,    //几秒后自动关闭，默认0时不关闭
                    anim: 1,    //动画效果
                    resize: false,  //设置成不允许拉伸
                    content: '../../../webhtml/loan/loan_collateral_movables_info_add.html?ID=' + data.ID + '&UUID=' + UUID,
                    end: function (date) {
                        table.reload("collateralMovablesInfo_id");
                    }
                });


            }


        });

    });


    //打开
    function openShare() {
        parent.layer.open({
            type: 2,    //弹出类型
            title: '新增股东',   //标题
            closeBtn: 1,    //显示关闭按钮
            shade: [0.3],   //遮罩透明度
            area: ['600px', '600px'],  //打开窗口的宽高
            time: 0,    //几秒后自动关闭，默认0时不关闭
            anim: 1,    //动画效果
            resize: false,  //设置成不允许拉伸
            content: '../../../webhtml/loan/loan_shareholder_add.html?UUID=' + UUID,
            end: function (date) {
                table.reload("shareholder_table_id");
            }
        });
    }

    //打开
    function openBankInfo() {
        parent.layer.open({
            type: 2,    //弹出类型
            title: '新增银行账户',   //标题
            closeBtn: 1,    //显示关闭按钮
            shade: [0.3],   //遮罩透明度
            area: ['500px', '300px'],  //打开窗口的宽高
            time: 0,    //几秒后自动关闭，默认0时不关闭
            anim: 1,    //动画效果
            resize: false,  //设置成不允许拉伸
            content: '../../../webhtml/loan/loan_bank_add.html?UUID=' + UUID,
            end: function (date) {
                table.reload("bank_info_tb_id");
            }
        });
    }

    //打开
    function openPersonnelSituation() {
        parent.layer.open({
            type: 2,    //弹出类型
            title: '新增人员情况',   //标题
            closeBtn: 1,    //显示关闭按钮
            shade: [0.3],   //遮罩透明度
            area: ['500px', '300px'],  //打开窗口的宽高
            time: 0,    //几秒后自动关闭，默认0时不关闭
            anim: 1,    //动画效果
            resize: false,  //设置成不允许拉伸
            content: '../../../webhtml/loan/loan_personnel_situation_add.html?UUID=' + UUID,
            end: function (date) {
                table.reload("personnel_situation_id");
            }
        });
    }

    //打开
    function opentPersonnelInfo() {
        parent.layer.open({
            type: 2,    //弹出类型
            title: '新增人员信息',   //标题
            closeBtn: 1,    //显示关闭按钮
            shade: [0.3],   //遮罩透明度
            area: ['700px', '80%'],  //打开窗口的宽高
            time: 0,    //几秒后自动关闭，默认0时不关闭
            anim: 1,    //动画效果
            resize: false,  //设置成不允许拉伸
            content: '../../../webhtml/loan/loan_personnel_info_add.html?UUID=' + UUID,
            end: function (date) {
                table.reload("personnel_info_id");
            }
        });
    }


    function openRealEstateInfo(){
        parent.layer.open({
            type: 2,    //弹出类型
            title: '新增不动产信息',   //标题
            closeBtn: 1,    //显示关闭按钮
            shade: [0.3],   //遮罩透明度
            area: ['700px', '80%'],  //打开窗口的宽高
            time: 0,    //几秒后自动关闭，默认0时不关闭
            anim: 1,    //动画效果
            resize: false,  //设置成不允许拉伸
            content: '../../../webhtml/loan/loan_realEstateInfo_add.html?UUID=' + UUID,
            end: function (date) {
                table.reload("realEstateInfo_id");
            }
        });
    }

    function openMovableInfo(){
        parent.layer.open({
            type: 2,    //弹出类型
            title: '新增动产信息',   //标题
            closeBtn: 1,    //显示关闭按钮
            shade: [0.3],   //遮罩透明度
            area: ['700px', '80%'],  //打开窗口的宽高
            time: 0,    //几秒后自动关闭，默认0时不关闭
            anim: 1,    //动画效果
            resize: false,  //设置成不允许拉伸
            content: '../../../webhtml/loan/loan_movable_info_add.html?UUID=' + UUID,
            end: function (date) {
                table.reload("movableInfo_id");
            }
        });
    }

    function openCollateralInfo(){
        parent.layer.open({
            type: 2,    //弹出类型
            title: '新增抵押物不动产信息信息',   //标题
            closeBtn: 1,    //显示关闭按钮
            shade: [0.3],   //遮罩透明度
            area: ['700px', '60%'],  //打开窗口的宽高
            time: 0,    //几秒后自动关闭，默认0时不关闭
            anim: 1,    //动画效果
            resize: false,  //设置成不允许拉伸
            content: '../../../webhtml/loan/loan_collateral_info_add.html?UUID=' + UUID,
            end: function (date) {
                table.reload("collateralInfo_id");
            }
        });
    }
        function openMovablesInfo(){

            parent.layer.open({
                type: 2,    //弹出类型
                title: '新增抵押物动产信息',   //标题
                closeBtn: 1,    //显示关闭按钮
                shade: [0.3],   //遮罩透明度
                area: ['700px', '60%'],  //打开窗口的宽高
                time: 0,    //几秒后自动关闭，默认0时不关闭
                anim: 1,    //动画效果
                resize: false,  //设置成不允许拉伸
                content: '../../../webhtml/loan/loan_collateral_movables_info_add.html?UUID=' + UUID,
                end: function (date) {
                    table.reload("collateralMovablesInfo_id");
                }
            });
        }
    // 取消
    function cancel() {
        // 当你在iframe页面关闭自身时
        var index = parent.layer.getFrameIndex(window.name); // 先得到当前iframe层的索引
        parent.layer.close(index); // 再执行关闭
    }

</script>
</body>
</html>